CREATE TABLE [dbo].[tb_CargosAfines]
(
[idCargoGenerico] [int] NOT NULL,
[idCargoGenericoAfin] [int] NOT NULL,
[idAsigGenerica] [int] NOT NULL,
[idAsigGenericaAfin] [int] NOT NULL
) ON [PRIMARY]
GO
CREATE UNIQUE CLUSTERED INDEX [idxCargosAfines] ON [dbo].[tb_CargosAfines] ([idCargoGenerico], [idCargoGenericoAfin], [idAsigGenerica], [idAsigGenericaAfin]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_CargosAfines] WITH NOCHECK ADD CONSTRAINT [FK_tb_CargosAfines_tb_AsignaturasGenericas] FOREIGN KEY ([idAsigGenericaAfin]) REFERENCES [dbo].[tb_AsignaturasGenericas] ([idAsignaturaGenerica])
GO
ALTER TABLE [dbo].[tb_CargosAfines] WITH NOCHECK ADD CONSTRAINT [FK_tb_CargosAfines_tb_CargosGenericos] FOREIGN KEY ([idCargoGenerico]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
ALTER TABLE [dbo].[tb_CargosAfines] WITH NOCHECK ADD CONSTRAINT [FK_tb_CargosAfines_tb_CargosGenericos2] FOREIGN KEY ([idCargoGenericoAfin]) REFERENCES [dbo].[tb_CargosGenericos] ([idCargoGenerico])
GO
